package day05.pm;

public class Demo06 {
    public static void main(String[] args) {
        //案例2：36块砖，36人搬，男搬4，女搬3，两个小孩抬一砖,有几种方法
        int x,y,z;
        /**
         * x+y+z=36
         * x*4+y*3+z/2=36
         * z%2==0
         */
        for(x=0;x<=36/4;x++){
            for(y=0;y<=36/3;y++){
                z = 36-x-y;
                if((x*4+y*3+z/2==36) && z%2==0){
                    System.out.println("男:"+x+",女:"+y+",小孩:"+z);
                }
            }
        }
    }
}
